package com.agileboot.domain.medicine.db;

import com.agileboot.common.core.page.PageDTO;
import com.agileboot.domain.medicine.command.MedicineCommand;
import com.agileboot.domain.medicine.dto.MedicineDTO;
import com.agileboot.domain.medicine.query.MedicineSearchQuery;
import com.agileboot.domain.medicine.query.MyMedicineQuery;
import com.agileboot.domain.medicine.vo.MedicineInfoVO;
import com.agileboot.domain.medicine.vo.MedicineVO;
import com.agileboot.domain.system.user.dto.UserDTO;
import com.agileboot.domain.system.user.dto.UserRanking;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import org.apache.ibatis.annotations.Param;

import java.io.IOException;
import java.util.List;


/**
 * (Medicine)表服务接口
 *
 * @author lx
 * @since 2023-12-02 14:20:00
 */
public interface MedicineService extends IService<Medicine> {
    /**
     * 获取草药列表
     *
     * @param page         页码对象
     * @param queryWrapper 查询对象
     * @return 分页处理后的草药列表
     */
    Page<Medicine> getMedicineList(Page<Medicine> page, @Param(Constants.WRAPPER) Wrapper<Medicine> queryWrapper);

    boolean isMedicineNameDuplicated(String name);

    List<MedicineInfoVO> getSuggestMedicineList() throws IOException;

    void addMedicine(List<MedicineCommand> commands) throws IOException;

    MedicineVO searchMedicineList(MedicineSearchQuery medicineSearchQuery) throws IOException;

    MedicineInfoVO getMedicineDetail(MedicineDTO medicineDTO) throws IOException;

    MedicineInfoVO getMedicineDetailById(String id) throws IOException;

    void uploadMedicine(MedicineCommand medicineCommand);

    PageDTO<Medicine> myUploadMedicineList(MyMedicineQuery myMedicineQuery);

    String delMyMedicine(String medicineId);

    List<UserRanking> rankingUserList();

}
